<?php

namespace App\Common\Http\Request;

use Hyperf\Validation\Request\FormRequest;

class SignRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }


    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'meetingId' => 'required',
            'username' => 'required',
            'type' => 'required|in:1,2,3,4',
        ];
    }

    public function messages(): array
    {
        return [
            'meetingId.required' => '缺少签到会议ID',
            'username.required' => '缺少用户姓名',
            'type.required' => '请正确选择签到类型',
            'type.in' => '请正确选择签到类型',
        ];
    }
}